private ["_uid","_return","_roles","_player_roles","_idx"];
_return = false;
_uid = "";
_roles = [];

if (typename _this == typename "") then {
	_uid = _this;
};
if (typename _this == typename []) then {
	if (count _this > 0) then {
		_uid = _this select 0;
	};
	if (count _this > 1) then {
		_roles = _this select 1;
	};
};
if (typename _uid == typename objNull) then {
	_uid = getPlayerUID _uid;
};
if (typename _roles == typename "") then {
	_roles = [_roles];
};
if (typename _roles != typename []) then {
	_roles = [];
};

if (_uid != "") then {
	if (!isnil "MSO_R_Players" && !isnil "MSO_R_PlayerRoles" && _uid != "") then {
		if (_uid in MSO_R_Players || (!isNil "MSO_R_Locals" && {count MSO_R_Locals > 0})) then {
			if (count _roles <= 0) then {
				_return = true;
			} else {
				_player_roles = [];
				_idx = (MSO_R_Players find _uid);
				if (_idx >= 0) then {
					_player_roles = MSO_R_PlayerRoles select _idx;
				};
				{
					if (toLower(_x) in _player_roles || (!isNil "MSO_R_Locals" && {(toLower(_x) in MSO_R_Locals)})) then { _return = true; };
				} foreach _roles;
			};
		};
	} else {
		_return = false;
	};
};
// diag_log format["MSO.%1|MPRIGHTS|HasRoles|%2|%3|%4|%5",time,_return,_this,isnil "MSO_R_Players",(MSO_R_Players find _uid)];
_return;